package cn.com.blueInfo.autoCode.vue;

public class CreateScriptService {

    public static String handler() {
        return "import api from './api'\n" +
                "\n" +
                "const service = {\n" +
                "    // 1. 新增操作\n" +
                "    add: {\n" +
                "        addData: async (data) => {\n" +
                "            const response = await null\n" +
                "            return response.data\n" +
                "        }\n" +
                "    },\n" +
                "    // 2. 查询操作\n" +
                "    read: {\n" +
                "        getData: async (id) => {\n" +
                "            const response = await null\n" +
                "            return response.data\n" +
                "        },\n" +
                "        getPageData: async (page, size, queryParam) => {\n" +
                "            const response = await null\n" +
                "            const data = response.data\n" +
                "            return {\n" +
                "                code: data.code,\n" +
                "                error: data.error,\n" +
                "                message: data.message,\n" +
                "                result: data.result,\n" +
                "                data: data.data,\n" +
                "                list: data.data.records,\n" +
                "                pagination: {\n" +
                "                    current: data.data.current,\n" +
                "                    pages: data.data.pages,\n" +
                "                    size: data.data.size,\n" +
                "                    total: data.data.total\n" +
                "                }\n" +
                "            }\n" +
                "        },\n" +
                "        getListData: async (queryParam) => {\n" +
                "            const response = await null\n" +
                "            return response.data\n" +
                "        }\n" +
                "    },\n" +
                "    // 3. 更新操作\n" +
                "    update: {\n" +
                "        modifyData: async (data) => {\n" +
                "            const response = await null\n" +
                "            return response.data\n" +
                "        },\n" +
                "        modifyPartialData: async (data) => {\n" +
                "            const response = await null\n" +
                "            return response.data\n" +
                "        }\n" +
                "    },\n" +
                "    // 4. 删除操作\n" +
                "    delete: {\n" +
                "        removeData: async (id) => {\n" +
                "            const response = await null\n" +
                "            return response.data\n" +
                "        }\n" +
                "    },\n" +
                "    // 5. 导出功能\n" +
                "    export: {\n" +
                "\n" +
                "    }\n" +
                "}\n" +
                "\n" +
                "export default service\n";
    }

}
